<?php 
namespace App\Factories;

use Validator;


class Factory {

	public function validate($data,$vali,$attrName = []){
		$validator = Validator::make($data, $vali);
		$validator ->setAttributeNames($attrName);
		if($validator->fails()){
			return $this->result(0,$validator->errors()->first());
		}
		return $this->result(1,"success");
	}

	public static function result($sta, $msg){
		return compact("sta","msg");
	}

}

?>